﻿using Basic.FlowRemoteModel.NodeFormData;
using Basic.FlowRemoteModel.NodeFormData.Model;
using Basic.FlowService.Interface;
using WeDonekRpc.Client.Interface;

namespace Basic.FlowService.RpcEvent
{
    internal class NodeFormDataRelationEvent : IRpcApiService
    {
        private readonly INodeFormDataRelationService _Service;

        public NodeFormDataRelationEvent ( INodeFormDataRelationService service )
        {
            this._Service = service;
        }
        public DataRelation[] GetsFormDataRelation ( GetsFormDataRelation obj )
        {
            return this._Service.Gets(obj.NodeId);
        }
        public void SetFormDataRelation ( SetFormDataRelation obj )
        {
            this._Service.Sync(obj.FlowId, obj.NodeId, obj.Relations);
        }
    }
}
